<?php
	
	class JS {		public function RedirectTo($new_href) {      echo "<script language='javascript'>window.location.replace('" . $new_href . "');</script>";      die();    }		public function NavigateTo($new_href) {      echo "<script language='javascript'>window.location.href = '" . $new_href . "';</script>";      die();		}
		
		public function ReplaceOpenerURL($newURL) {
			echo "<script language='JavaScript'>window.opener.location.replace('$newURL');</script>";
		}
		
		public function Refresh() {
			echo "<script language='JavaScript'>window.location.reload();</script>";
			die();
		}
		
		public function RefreshOpener() {
			echo "<script language='JavaScript'>window.opener.location.reload();</script>";
		}
		
		public function IfOpenerLocationEqualsCurrentRefresh($url) {
			echo "<script language='JavaScript'>if(window.opener.location == '" . $url . "') window.opener.location.reload();</script>";
		}
		
		public function RefreshOnce() {
			if (!$_SESSION['_refresh_once']) {
				$_SESSION['_refresh_once'] = true;
				echo "<script language='JavaScript'>window.location.reload();</script>";
				die();
			} else {
				unset($_SESSION['_refresh_once']);
			}
			
		}
	
	}
	
?>